package com.usercar.service.impl;

import com.usercar.pojo.Years;
import com.usercar.mapper.YearsMapper;
import com.usercar.service.IYearsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-08-14
 */
@Service
public class YearsServiceImpl extends ServiceImpl<YearsMapper, Years> implements IYearsService {

    @Autowired
    private YearsMapper yearsMapper;
    @Override
    public Years selectByYears(Integer time) {
        Map<String,Object> map = new HashMap<>();
        map.put("year_time",time);
        List<Years> years = yearsMapper.selectByMap(map);
        return years.get(0);
    }
}
